1. Field of the Invention
The present invention relates generally to an improved data processing system and in particular to a method and apparatus for processing data. Still more particularly, the present invention relates to a computer implemented method, apparatus, and computer usable program code for processing packets for transmission on a network.
2. Description of the Related Art
Computers and other devices on a network, such as a local area network (LAN) or the Internet, often exchange data with other computers or devices. For example, a word processing application may retrieve a document from storage device located on another computer or save a document onto a storage device on another computer. A browser application may send information, such as a request for a web page. In response to the request, the browser application may receive a web page from a web site located on a server computer. Further, the browser application may send information, such as data entered into a form on a downloaded web page to a server. All of these different types of data transmissions are accomplished by sending data across a network connection using discrete segments of data. The data sent on to a network is referred to as a packet.
Operating systems typically include a network protocol stack that is used to transmit data received by an application for transmission on to a network. This data is typically received in the form of a set of memory locations, such as a set of buffers in the memory of a computer.
Normally, data for packets are stored in system buffers. The data in these types of buffers are either copied by the network device driver to pre-registered transmit buffers or the system buffers are registered dynamically or “on-the-fly” to allow the network adapter to access the data in these buffers. In transmitting data in packets, the network adapter requires access to the memory buffer.
The process of obtaining the memory address accessible by a network adapter and making the underlying memory visible to the network adapter is referred to as “registration”. The processor cycles and/or execution time for registration are significant with respect to performance in transmitting packets. If the buffer in which data for a packet is not registered or cannot be registered, then the data is copied to a buffer or memory location that can be accessed by the adapter. This process also takes time and resources.
The networking protocol in the AIX® operating system currently implements interface specific network buffers. AIX® is a registered trademark of International Business Machines Corporation. These types of buffers may be used to improve the performance or speed at which data is transmitted by a networking protocol stack on to the network, due to the fact that these interface specific network buffers are pre-registered with the network adapter.
Performance gains are obtained with these types of buffers because a network device driver does not have to copy a packet for transmission to pre-registered transmit buffers. As a result, the overhead of a copy operation needed to place data received from an application into pre-registered transmit buffers is avoided. In some cases, the network device driver does not have to perform an on-the-fly or dynamic registration of a transmit buffer containing a packet for transmission. This situation results in avoiding a series of system calls that require time in terms of processor cycles and/or completion time.
As a result, interface specific buffers provide a significant performance advantage for transmitting data because the data does not have to be copied or registered dynamically.
In some cases, however, the application may pass a list of network buffers in which this list contains both interface specific buffers and regular or non-interface specific buffers. This list may result in data for a packet for transmission to contain both interface specific buffers and non-interface specific buffers. The processing of data found in mixed types of buffers like these result in the network device driver treating the entire packet as being located in a non-interface specific buffer. As a result, both interface specific buffers and non-interface specific buffers are treated the same in which either a registration of the buffers occurs or the data is copied into pre-registered buffers.